package cn.fz.mpdemo.utils;

import cn.hutool.json.JSONUtil;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

public class HttpUtils {
    public static void responseWriter(HttpServletResponse response, Object obj){
        String errStr = JSONUtil.toJsonStr(obj);
        response.setContentType("application/json;charset=utf-8");
        try {
            response.getWriter().write(errStr);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
